﻿namespace Origin2.Core
{
    /// <summary>
    /// An interface for something that uses Controls
    /// </summary>
    public interface IControllable
    {
        /// <summary>
        /// Adds a Control to this IControllable
        /// </summary>
        /// <param name="name"> The name of the Control </param>
        /// <param name="control"> The Control to add </param>
        void AddControl(string name, Control control);

        /// <summary>
        /// Gets a Control from this IControllable
        /// </summary>
        /// <param name="name"> The name of the Control to find </param>
        /// <returns> The found Control </returns>
        Control GetControl(string name);

        /// <summary>
        /// Removes a Control from this IControllable
        /// </summary>
        /// <param name="name"> The name of the Control to remove </param>
        void RemoveControl(string name);

        /// <summary>
        /// Gets whether this IControllable has a Control with the given name
        /// </summary>
        /// <param name="name"> The name to search for </param>
        /// <returns> Whether there is a Control with the given name </returns>
        bool ContainsControl(string name);

        /// <summary>
        /// Gets whether this IControllable has the given Control
        /// </summary>
        /// <param name="control"> The Control to search for </param>
        /// <returns> Whether this IControllable contains the given Control </returns>
        bool ContainsControl(Control control);

        /// <summary>
        /// Gets whether this IControllable has a Control with the given type
        /// </summary>
        /// <typeparam name="TControlType"> The Type of Control to search for </typeparam>
        /// <returns> Whether there is a Control of the given Type </returns>
        bool ContainsControlType<TControlType>();
    }
}
